function help() {
	echo "Usage: build.sh [restart profile]"
}

function restart() {
    shift
    echo "stop start"
    ps -ef|grep sgst-job|grep -v grep|awk '{print $2}'|xargs -i kill -9 {}
    echo "stop end"
    nohup java -Xmx512M -jar $PWD/sgst-job-1.0-SNAPSHOT.jar --spring.profiles.active="$@" &
    echo "restart end"
}

case "$1" in
"restart")
    restart "$@"
    ;;
*)
    help
    ;;
esac

